refactor: Improve and document Testplan.get_stage_regressions#232
Open
rswarbrick wants to merge 1 commit into
Open
refactor: Improve and document Testplan.get_stage_regressions#232rswarbrick wants to merge 1 commit into
rswarbrick wants to merge 1 commit into
Conversation
This was prompted by trying to understand the function in order to document what it did. Changes to the code: - Sort the tests associated with a stage instead of using the default ordering that was presumably based on the way the set of tests got built up from testpoints. - Explicitly use Testpoint.stages for the class variable instead of tp.stages: I wasted five minutes trying to figure out what was going on here. - Avoid the "ms" name (the thing that is now called a development stage was called a milestone in OpenTitan until 2022: see d1aeac6). - Use setdefault instead of a defaultdict - Iterate over items rather than iterating over keys and doing a lookup each time. Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(I was inspired by doing some simple bug fixes, so I picked the next undocumented function in the file...)
This was prompted by trying to understand the function in order to document what it did. Changes to the code:
Sort the tests associated with a stage instead of using the default ordering that was presumably based on the way the set of tests got built up from testpoints.
Explicitly use Testpoint.stages for the class variable instead of tp.stages: I wasted five minutes trying to figure out what was going on here.
Avoid the "ms" name (the thing that is now called a development stage was called a milestone in OpenTitan until 2022: see d1aeac6).
Use setdefault instead of a defaultdict
Iterate over items rather than iterating over keys and doing a lookup each time.